package com.heima.utils.thread;

import com.heima.model.admin.pojos.AdminUser;
import com.heima.model.wemedia.pojos.WmUser;

public class AdThreadLocalUtils {

    private final static ThreadLocal<AdminUser> WM_USER_THREAD_LOCAL = new ThreadLocal<>();

    /**
     * 添加用户
     * @param
     */
    public static void  setUser(AdminUser adminUser){
        WM_USER_THREAD_LOCAL.set(adminUser);
    }

    /**
     * 获取用户
     */
    public static AdminUser getUser(){
        return WM_USER_THREAD_LOCAL.get();
    }

    /**
     * 清理用户
     */
    public static void clear(){
        WM_USER_THREAD_LOCAL.remove();
    }
}